3882aa8
@@ -85,11 +85,21 @@
public void deleteRow() throws SQLException {
   }
 
   public int findColumn(String columnName) throws SQLException {
-    int columnIndex = normalizedColumnNames.indexOf(columnName.toLowerCase());
-    if (columnIndex==-1) {
-      throw new SQLException();
+    int columnIndex = 0;
+    boolean findColumn = false;
+    for (String normalizedColumnName : normalizedColumnNames) {
+      ++columnIndex;
+      String[] names = normalizedColumnName.split("\\.");
+      String name = names[names.length -1];
+      if (name.equalsIgnoreCase(columnName) || normalizedColumnName.equalsIgnoreCase(columnName)) {
+        findColumn = true;
+        break;
+      }
+    }
+    if (!findColumn) {
+      throw new SQLException("Could not find " + columnName + " in " + normalizedColumnNames);
     } else {
-      return ++columnIndex;
+      return columnIndex;
     }
   }
 
